import { request } from "http";
import requestService from "../service/request";
const Api = {
  create: "/film/order/submitOrder",
  pay: "/film/order/payOrder",
  detail: "/film/order/getOrderDetail",
  orderList: "/film/order/orderList",
  cancel: "/film/order/cancelOrder",
  interceptOrder: "/film/order/orderInter",
  feedBack: "/film/cinema/insertUserFeedback",
  url: "/film/order/getOrderTicketCode",
};

//创建订单接口
export function createOrder(data) {
  return requestService(Api.create, {
    type: "post",
    data,
  });
}
// 支付接口
export function payOrder(data) {
  return requestService(Api.pay, {
    type: "post",
    data,
    paramsFormdata: "application/x-www-form-urlencoded",
  });
}

//获取订单详情信息
export function orderDetail(data) {
  return requestService(Api.detail, {
    type: "get",
    data,
    paramsFormdata: "application/x-www-form-urlencoded",
  });
}

//获取当前的订单列表
export function orderList(data) {
  return requestService(Api.orderList, {
    type: "post",
    data,
  });
}

//取消订单

export function cancelOrder(data) {
  return requestService(Api.cancel, {
    type: "post",
    data,
    paramsFormdata: "application/x-www-form-urlencoded",
  });
}

//尝试拦截麻花订单
export function interceptOrder(data) {
  return requestService(Api.interceptOrder, {
    type: "post",
    data,
    // paramsFormdata: "application/x-www-form-urlencoded",
  });
}

// 提交反馈
export function submitFeedBack(data) {
  return requestService(Api.feedBack, {
    type: "post",
    data,
    // paramsFormdata: "application/x-www-form-urlencoded",
  });
}

// film/order/getOrderTicketCode
// 订单取票码链接
export function getUrlByVote(data) {
  return requestService(Api.url, {
    type: "get",
    data,
    paramsFormdata: "application/x-www-form-urlencoded",
  });
}
